package com.sumainfor.pc.gmio.controller.housekeeper;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.gmio.service.HoGasMeterService;
import com.sumainfor.pc.gmio.service.HoWaterMeterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.Serializable;
import java.util.Map;

/**
 * 服务管家录入燃气表数
 */
@RestController
@RequestMapping("/secretary/HoGasMeter")
public class HoGasMeterController implements Serializable {
    @Autowired
    private HoGasMeterService hoGasMeterService;
    /**
     * 查询电表的信息列表
     */
    @PostMapping("/getHoGasMeterList")
    public JsonResult getHoGasMeterList(@RequestBody Map<String,Object>params){
        System.out.println("接收到达参数:"+params);
        return hoGasMeterService.getHoGasMeterList(params);
    }
    /**
     * 服务管家录入电表数
     */
    @PostMapping("/addHoGasMeter")
    public JsonResult addHoGasMeter(@RequestBody Map<String,Object>params){
        return hoGasMeterService.addHoGasMeter(params);
    }
    /**
     *服务管家退租的时候查询上次的燃气抄表数
     */
    @GetMapping("/getHoGasMeterLast")
    public JsonResult getHoGasMeterLast(@RequestParam Map<String,Object>params){
        JsonResult result=new JsonResult();
        return result.put(hoGasMeterService.getHoGasMeterLast(params));
    }
    /**
     *根据燃气表抄表编号查询一个批次录入的一套房源的表数
     */
    @GetMapping("/getHoGasMeterBatc")
    public JsonResult getHoGasMeterBatc(@RequestParam Map<String,Object>params){
        return hoGasMeterService.getHoGasMeterBatc(params);
    }
    /**
     *租后主管撤回电表账单(账单错误)
     */
    @PostMapping("/recallHoGasMeter")
    public JsonResult recallHoGasMeter(@RequestBody Map<String,Object>params){
        return hoGasMeterService.recallHoGasMeter(params);
    }
    /**
     *租后主管撤回电表账单(审核错误)
     */
    @PostMapping("/examHoGasMeter")
    public JsonResult examHoGasMeter(@RequestBody Map<String,Object>params){
        return hoGasMeterService.examHoGasMeter(params);
    }
}
